// 引入request
import request from '../util/request.js';

const TechniqueMatRequest = {
    BASE_URL : "http://localhost:8085/pro",
    // 请求过程在这里开发，不在.vue文件中开发
    /**
     * 分页查询产品物料的API
     * @param techniqueMat
     * @param callBack
     */
    loadTechniqueMat(techniqueMat, callBack){
        // 拼接url  /sys/queryByPage?xxx
        console.dir(techniqueMat)
        let url = this.BASE_URL + "/techniqueMat/queryByPage";
        //let url = this.BASE_URL + "/techniqueMat/queryByPage";  调用request进行请求  http://lcation
        request.get(url,techniqueMat,callBack);
    },

    /**
     * 添加产品物料的API
     * @param techniqueMat
     * @param callBack
     */
    addTechniqueMat(techniqueMat,callBack){
        let url = this.BASE_URL + "/techniqueMat/saveMat"
        request.post(url,techniqueMat,callBack);
    }
    ,
    /**
     * 修改步骤信息的API
     * @param techniqueMat
     * @param callBack
     */
    updateTechniqueMat(techniqueMat,callBack){
        let url = this.BASE_URL + "/techniqueMat/updateMat";
        request.post(url,techniqueMat,callBack);
    },
    /**
     *  删除步骤的API
     *  @param matId
     *  @param callBack
     */
    deleteTechniqueMat(matId,callBack){
        request.get(this.BASE_URL + "/techniqueMat/delete?matId=" + matId,null,callBack);
    },
    /**
     * 批量删除步骤的API
     * @param matIds
     * @param callBack
     */
    deleteTechniqueMats(matIds,callBack){
        let url = this.BASE_URL + "/techniqueMat/deletes?a=1&matIds="+matIds;
        request.get(url,null,callBack);
    },
    /**
     * 根据id查询步骤的API
     * @param matId
     * @param callBack
     */
    getById(matId,callBack){
        request.get(this.BASE_URL + "/techniqueMat/queryById?matId=" + matId,null,callBack);
    }
}
export default TechniqueMatRequest;